package com.example.testspring;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Properties;

@SpringBootApplication
public class TestSpringApplication {

    public static void main(String[] args) {
        SpringApplication.run(TestSpringApplication.class, args);
        URL resource = TestSpringApplication.class.getClassLoader().getResource("db/changelog/basic.xml");
        System.out.println(resource);
        InputStream resourceAsStream = TestSpringApplication.class.getClassLoader().getResourceAsStream("application.properties");
        Properties properties = new Properties();
        try {
            properties.load(resourceAsStream);
            properties.forEach((k,v)->{
                System.out.println(k+"="+v);
            } );
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

    }

}
